package com.geotmt.billingcenter.modules.consume.mapper;

import com.geotmt.billingcenter.common.entry.ConsumeBaseHisEntry;
import com.geotmt.billingcenter.common.vo.consume.ConsumeHisVo;
import com.geotmt.billingcenter.common.vo.params.ParamsConsume;
import com.geotmt.billingcenter.common.vo.params.ParamsForDel;
import com.geotmt.billingcenter.modules.consume.mapper.provider.ConsumeBaseHisProvider;
import org.apache.ibatis.annotations.*;

import java.util.Date;
import java.util.List;

/**
 * @Description 类描述
 * @Author      yanghanwei
 * @Mail        yanghanwei@geotmt.com
 * @Date        2019/3/13 14:45
 * @Version     v1
 **/
@Mapper
public interface ConsumeBaseHisMapper {

    /**
     * 添加历史消耗 Base
     * @param consumeBaseHis
     * @return
     */
    @InsertProvider(type = ConsumeBaseHisProvider.class, method = "add")
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    Integer addBaseHis(ConsumeBaseHisEntry consumeBaseHis);

    /**
     * 删除历史消耗 Base
     * @param obj
     */
    @UpdateProvider(type = ConsumeBaseHisProvider.class, method = "delete")
    void deleteBaseHis(ParamsForDel obj);


    /**
     * 历史消耗 list
     * @param obj
     * @return
     */
    @SelectProvider(type = ConsumeBaseHisProvider.class, method = "list")
    List<ConsumeHisVo> listHis(ParamsConsume obj);

    /**
     * 更新有效结束时间
     * @param preDay
     * @param id
     */
    @UpdateProvider(type = ConsumeBaseHisProvider.class, method = "updateEndEffect")
    void updateEndEffect(@Param(value = "preDay") Date preDay,
                         @Param(value = "id") Integer id);
}
